import request from "@/utile/request.js";

// 登录接口
export const checkLogin =  (data) => {
    return request.post("/users/checkLogin",data);
}

//获取个人信息
export const getUserInfo = (params) => {
    return request.get("/users/accountinfo",{params});
}

//axios get请求 可以将参数放在params中
//request.get('/users/list', {params: data})
//获取用户列表
export const getUserList = (currentPage,pageSize) => {
    const str = `/users/list?currentPage=${currentPage}&pageSize=${pageSize}`
    return request.get(str);
}

//添加账号
export const addUser = (data)=>{
    return request.post("/users/add",data)
}

//修改账号
export const editUser = (data)=>{
    return request.post("/users/edit",data)
}

//删除账号
export const deleteUser = (params)=>{
    return request.get("/users/del",{params})
}

//修改密码
export const editPassword = (data)=>{
    return request.post("/users/editpwd",data)
}

//修改头像
export const editAvatar = (data)=>{
    return request.post("/users/avataredit",data)
}

//批量删除
export const batchDelete = (params)=>{
    return request.get("/users/batchdel",{params})
}

//检查旧密码
export const checkOldPwd = (params)=>{
    return request.get("/users/checkoldpwd",{params})
}